<template>
  <view class="content">
    <uni-nav-bar
      title="订单详情"
      color="#fff"
      backgroundColor="transparent"
      :border="false"
      :statusBar="true"
      :fixed="true"
      @clickLeft="$c.back()"
    >
      <view class="uni-nav-bar-l-icon" slot="left">
        <view class="uni-nav-bar-l-icon-left icon">
          <image :src="$img('/static/img2/cc20.png')" lazy-load></image>
        </view>
      </view>
    </uni-nav-bar>

    <!-- 地址 -->
    <view v-if="goods" class="address_z">
      <view class="address_z_r">
        <view>
          <text style="font-size: 28rpx; font-weight: 600">
            {{ goods.name }}
          </text>
          <text style="color: #fff; margin-left: 10rpx">
            {{ goods.mobile }}
          </text>
        </view>
        <view style="margin-top: 20rpx">{{ goods.address }}</view>
      </view>
    </view>
    <!-- 赏品 -->
    <view v-if="goods" class="xuyuan">
      <view class="pic">
        <image :src="goods.order_list.imgurl" lazy-load></image>
      </view>

      <view class="bd-info">
        <view class="title hang1">
          {{ goods.order_list.title }}
        </view>

        <view class="sku">{{ goods.order_list.sku.join('') }}</view>

        <view class="price-num">
          <view>¥{{ goods.order_list.price }}</view>

          <view class="num">×{{ goods.order_list.num }}</view>
        </view>
      </view>
    </view>
    <!-- 时间 -->
    <view v-if="goods" class="dingdan">
      <view>提交时间：{{ goods.addtime }}</view>
      <view style="border: none">订单号：{{ goods.order_num }}</view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      z_imgPath: this.$z_img2,
      goods: '',
      list: {}
    }
  },
  onLoad(e) {
    this.getData(e.id)
  },
  methods: {
    back() {
      uni.navigateBack()
    },

    getData(e) {
      // 模拟接口
      let that = this
      that.req({
        url: 'order_detail',
        Loading: true,
        data: {
          order_id: e
        },
        success(res) {
          if (res.status == 1) {
            that.goods = res.data.order
          }
        }
      })
    }
  }
}
</script>

<style lang="scss">
.list_img .shang_title {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.8);
  left: 0;
  /* width: 100%; */
  color: #333;
  font-size: 24rpx;
  /* font-family: 'zcq'; */
  text-align: left;
  padding: 4rpx 10rpx;
  box-sizing: border-box;
  /* border: 1px solid #000000; */
  width: 100%;
  display: flex;
  justify-content: space-between;

  .type {
    font-size: 22rpx;
    font-family: zihun147hao-xingyuanhei;
    font-weight: 400;
    color: #fff;
  }

  .num {
    font-size: 20rpx;
    font-family: Source Han Sans CN;
    font-weight: 400;
    color: #ffffff;
  }
}

.list_img > image {
  width: 100%;
  height: 100%;
  // margin: 1rpx auto;
}

.list_img {
  box-sizing: border-box;
  width: 100%;
  height: 170rpx;
  position: relative;
  border: 1px solid;
  border-image: linear-gradient(90deg, #2dcbff, #ff95fb) 1 1;
}

.dingdan > view {
  padding: 20rpx 0;
}

.dingdan {
  width: 690rpx;
  margin: 20rpx auto;
  padding: 0 30rpx;
  box-sizing: border-box;
  font-size: 28rpx;
  background: #252525;
  border: 2rpx solid #444444;

  font-size: 24rpx;
  color: #ffffff;
}

.address_z_r {
  // width: 584rpx;
  // margin-left: 30rpx;
}

.address_z > image {
  width: 50rpx;
  height: 50rpx;
}

.address_z {
  width: 690rpx;
  margin: 20rpx auto;
  padding: 30rpx;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  font-size: 24rpx;
  color: #ffffff;

  background: #252525;
  border: 2rpx solid #444444;
}

.xuyuan_item_2 {
  color: #ffffff;
  font-size: 24rpx;
  width: 100%;
  margin-top: 6rpx;
}

.xuyuan_item > image {
  width: 180rpx;
  height: 180rpx;
  border-radius: 10rpx 10rpx 0 0;
}

.xuyuan_item {
  width: 170rpx !important;
  // height: 240rpx;
  // box-sizing: border-box;
  // padding: 18rpx 20rpx 0;

  margin: 0 10rpx;
}

.xuyuan_con {
  display: flex;
  margin: 14rpx auto 0;
  width: 630rpx;
  box-sizing: border-box;
  overflow-x: scroll;
}

.xuyuan {
  width: 690rpx;
  margin: 24rpx auto 0;
  padding: 30rpx 30rpx 30rpx;
  box-sizing: border-box;
  display: flex;
  align-items: center;

  background: #252525;
  border: 2rpx solid #444444;

  .pic {
    width: 140rpx;
    height: 140rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    border: 2rpx solid #000000;
    box-sizing: border-box;

    image {
      width: 100%;
      height: 100%;
    }
  }

  .bd-info {
    width: calc(100% - 140rpx);
    box-sizing: border-box;
    padding-left: 16rpx;

    .title {
      font-family: PingFang SC, PingFang SC;
      font-weight: 400;
      font-size: 28rpx;
      color: #ffffff;
    }

    .sku {
      margin: 6rpx 0;

      font-family: PingFang SC, PingFang SC;
      font-weight: 400;
      font-size: 22rpx;
      color: #c3c3c3;
    }

    .price-num {
      display: flex;
      justify-content: space-between;
      align-items: center;

      font-family: PingFang SC, PingFang SC;
      font-weight: 400;
      font-size: 26rpx;
      color: #e40d88;

      .num {
        font-family: PingFang SC, PingFang SC;
        font-weight: 400;
        font-size: 22rpx;
        color: #cccccc;
      }
    }
  }
}

.content {
  width: 100vw;
  min-height: 100vh;
  padding-top: 1rpx;
  box-sizing: border-box;
}
</style>
